package com.pishou.code.bean;

import com.alibaba.fastjson.JSONObject;
import com.pishou.ParamConfig;

public class Comment {

    private Integer id;
    private String head;
    private String name;
    private String content;
    private Integer picture;
    private Integer video;
    private Integer rotation;
    private String date;
    private Long sku;
    private String product_name;
    private Integer score;
    private Integer append_id;
    private Integer append_picture;
    private String append_content;
    private Boolean append_flag;

    private String commentVideoPath;

    public Comment(){

    }

    public Comment(JSONObject comment_json){
        this.id = comment_json.getInteger("id");
        this.head = comment_json.getString("head");
        this.name = comment_json.getString("name");
        this.content = comment_json.getString("content");
        this.picture = comment_json.getInteger("picture");
        this.video = comment_json.getInteger("video");
        this.date = comment_json.getString("date");
        this.sku = comment_json.getLong("sku");
        this.product_name = comment_json.getString("product_name");
        this.score = comment_json.getInteger("score");
        this.append_flag = comment_json.getBoolean("append_flag");
        if (append_flag){
            JSONObject append = comment_json.getJSONObject("append");
            this.append_id = append.getInteger("id");
            this.append_picture = append.getInteger("picture");
            this.append_content = append.getString("content");
        }
        this.commentVideoPath  = ParamConfig.file_path + "/video/"+this.id+".mp4";
        this.rotation = comment_json.getInteger("rotation");
    }

    public Integer getId(){
        return this.id;
    }
    public String getHead(){
        return  this.head;
    }
    public String getName(){
        return this.name;
    }
    public String getContent(){
        return this.content;
    }
    public Integer getPicture(){
        return this.picture;
    }
    public String getDate() {
        return date;
    }
    public Long getSku() {
        return sku;
    }
    public String getProduct_name() {
        return product_name;
    }
    public Integer getScore() {
        return score;
    }
    public String getAppend_content() {
        return append_content;
    }
    public Integer getAppend_picture() {
        return append_picture;
    }
    public Integer getAppend_id() {
        return append_id;
    }
    public Integer getVideo() {
        return video;
    }
    public String getCommentVideoPath() {
        return commentVideoPath;
    }
    public Integer getRotation() {
        return rotation;
    }
}
